package tq.com.tqteacher.view;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import java.security.PublicKey;

import tq.com.tqteacher.R;

public class TQHeader3ViewHold {
    private Context context;
    private View view;

    public ImageView backView;
    public TextView titleView;
    public TextView rightView;

    public TQHeader3ViewHold(Context context, View v){
        this.context = context;
        view = v;

        initView();
    }

    private void initView(){
        backView = view.findViewById(R.id.back_icon);
        titleView = view.findViewById(R.id.title);
        rightView = view.findViewById(R.id.rightItem);
    }


    public void setTitle(String t){
        titleView.setText(t);
    }

    public void setBackClick(View.OnClickListener onClickListener){
        backView.setOnClickListener(onClickListener);
    }

    public void showRightItem(View.OnClickListener pOnClickListener){
        rightView.setVisibility(View.VISIBLE);
        rightView.setOnClickListener(pOnClickListener);
    }

    public void hideBackView(){
        backView.setVisibility(View.INVISIBLE);
    }

}
